﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using DAL.Mappers;
using Frw;

namespace ServiceLayer
{
    public class PVRAuthentication : FacadeBase<IAuthentication, UserAuthentication, BetpointAdvancedEntities>, IAuthentication
    {
        public bool ValidateUser(BLL.User user)
        {
            throw new NotImplementedException();
        }

        public BLL.User GetUser(BLL.User user)
        {
            BLL.User retValue = null;

            var obj = from x in ((BetpointAdvancedEntities)this.GetContext()).utenti where x.id_utente == user.Id select x;

            UserMapper um = new UserMapper();
            retValue = um.ToDTO(obj).FirstOrDefault();

            return retValue;
        }
    }
}
